<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>场地信息管理</title>
    <link rel="stylesheet" type="text/css" href="/site_jquery-easyui-1.3.3/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="/site_jquery-easyui-1.3.3/themes/icon.css">
    <script type="text/javascript" src="/site_jquery-easyui-1.3.3/jquery.min.js"></script>
    <script type="text/javascript" src="/site_jquery-easyui-1.3.3/jquery.easyui.min.js"></script>
    <script type="text/javascript" src="/site_jquery-easyui-1.3.3/locale/easyui-lang-zh_CN.js"></script>
    <script type="text/javascript">
        var url;
        function search(){
            $("#dg").datagrid('load',{
                "status":$("#status").combobox("getValue"),
                "whenTime":$("#whenTime").combobox("getValue"),
                "applicationTime":$("#applicationTime").datebox('getValue')


            });
        };

        function saveSite(){
            $("#fm").form("submit",{
                url:url,
                success:function(result){
                    var result=eval('('+result+')');
                    if(result.success){
                        $.messager.alert("系统提示","操作成功");
                        closeDialog();
                        $("#dg").datagrid("reload");
                    }else{
                        $.messager.alert("系统提示","操作失败");
                        return;
                    }
                }
            });
        };

        function openlookDialog(){
            var selectedRows=$("#dg").datagrid('getSelections');
            if(selectedRows.length!=1){
                $.messager.alert("系统提示","请选择一条要查看的数据！");
                return;
            }
            var row=selectedRows[0];
            $("#dlg").dialog("open").dialog("setTitle","查看场地信息明细");
            $('#fm').form('load',row);
            $('#btn').linkbutton('disable');
            $('#siteStatus').combo('readonly', true);
        };

        function openModifyDialog(){

            var selectedRows=$("#dg").datagrid('getSelections');
            if(selectedRows.length!=1){
                $.messager.alert("系统提示","请选择一条要审核预约的数据！");
                return;
            }
            var row=selectedRows[0];
            if(row.status!="正在审核"){
                $.messager.alert("系统提示","请选择一条正在审核的数据！");
                return;
            }
            $("#dlg").dialog("open").dialog("setTitle","查看申请预约信息明细");
            $('#fm').form('load',row);
            url="/siteReservation/modifyShenqingZhuangtai";

        };

        function closeDialog(){
            $("#dlg").dialog("close");

            $("#fm").form("clear");


        };

    </script>
</head>
<body style="margin:1px;">
<table id="dg" title="我的预约信息" class="easyui-datagrid"
       fitColumns="true" pagination="true" rownumbers="true" singleSelect="true"
       url="/siteReservation/findAllSiteReservation" fit="true" toolbar="#tb">
    <thead>
    <tr>
        <!--  private Integer siteYyId;
    private Integer userId;
    private Integer siteId;
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date applicationTime;
    @JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")
    private Date returnTime;
    private String whenTime;
    private String status;
    private Integer amdinId;
    private String reason;
-->
        <th field="siteYyId" width="50" align="center">编号</th>
        <th field="userName" width="50" align="center">申请用户</th>
        <th field="name" width="60" align="center">场地名称</th>
        <th field="position" width="90" align="center">场地位置</th>
        <th field="applicationTime" width="85" align="center" >租借日期</th>
        <th field="whenTime" width="80" align="center" >时间段</th>
        <th field="status" width="80" align="center">状态</th>
        <th field="price" width="60" align="center">价格</th>


    </tr>
    </thead>
</table>
<div id="tb">
    <div>

        <a href="javascript:openModifyDialog()" class="easyui-linkbutton" iconCls="icon-edit" plain="true">审核预约</a>

    </div>
    <div>

        &nbsp;状态：&nbsp;<input class="easyui-combobox" name="status" id="status" style="width: 135px;"
                              data-options="
                                    url:'/siteReservation/findStatus',
									valueField:'id',
									textField:'text',
									panelHeight:'auto',

                                    ">
        &nbsp;申请日期：&nbsp;<input class="easyui-datebox" name="applicationTime" id="applicationTime" style="width: 135px;"></input>
        &nbsp;时间段：&nbsp;<select id="whenTime" class="easyui-combobox" name="whenTime" panelHeight="auto" style="width: 135px;">
            <option value="" selected>请选择:</option>
            <option value="08:10-09:45">08:10-09:45</option>
            <option value="10:15-11:50">10:15-11:50</option>
            <option value="14:30-16:05">14:30-16:05</option>
            <option value="16:30-18:05">16:30-18:05</option>
        </select>

        &nbsp;<a href="javascript:search()" class="easyui-linkbutton" iconCls="icon-search" plain="true">搜索</a>
    </div>
</div>

<div id="dlg" class="easyui-dialog" style="width: 620px;height:250px;"
     closed="true"  closable="false" buttons="#dlg-buttons">
    <form id="fm"  enctype="multipart/form-data"  method="post">
        <table >
            <tr><td><input name="siteId"  type="hidden"></td></tr>
            <tr><td><input name="siteYyId"  type="hidden"></td></tr>
            <tr><td><input name="userId"  type="hidden"></td></tr>
            <tr><td><input name="applicationTime"  type="hidden"></td></tr>
            <tr><td><input name="whenTime"  type="hidden"></td></tr>
            <tr>
                <td valign="top">申请理由：</td>
                <td colspan="8">
                    <textarea rows="5" cols="60" id="reason" name="reason"></textarea>
                </td>
            </tr>

        </table>
    </form>
</div>

<div id="dlg-buttons">
    <a href="javascript: saveSite()" id="btn" class="easyui-linkbutton" iconCls="icon-ok">同意申请</a>
    <a href="javascript: closeDialog()" class="easyui-linkbutton" iconCls="icon-cancel">关闭</a>
</div>
</body>
</html>